﻿<Window
        xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm = "clr-namespace:MtmDeepCopy"
        xmlns:wrp = "clr-namespace:Sogeti.QueryWrapper" 
        xmlns:PlatformUI="clr-namespace:Microsoft.VisualStudio.PlatformUI;assembly=Microsoft.VisualStudio.Shell.11.0" 

        xmlns:d = "http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc = "http://schemas.openxmlformats.org/markup-compatibility/2006"  
        x:Class = "MtmDeepCopy.MainWindow"
        Title = "Test Plan Builder" Height = "600" Width = "1200"
        Name = "wndMain" Closing = "wndMain_Closing">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key = "BooleanToVisibilityConverter"/>
        
        <HierarchicalDataTemplate  x:Key = "NodeTemplate" ItemsSource = "{Binding XPath = child::*}">
            <StackPanel Orientation = "Horizontal" VerticalAlignment = "Center" HorizontalAlignment = "Stretch">
                <Image Name = "imgTestStatus" Visibility = "Collapsed"  Margin = "0,0,5,0" Opacity = "50"/>
                <Image Name = "imgCopyType" Source = "../Resources/Copy.gif" Visibility = "Collapsed"  />
                <Image Name = "imgStereotype" Source = "../Resources/TestSuiteStatic.gif"  Visibility = "Collapsed"   />
                <TextBlock x:Name = "txtId"  >
                    <TextBlock.Text>
                        <Binding XPath = "@SuiteId" StringFormat = "{}{0:d}: "/>
                    </TextBlock.Text>
                </TextBlock>
                <TextBlock x:Name = "txt" Text = "{Binding XPath = @Name}"  />
                <TextBox x:Name = "txtEdit" Text = "{Binding XPath = @Name}" Visibility = "Collapsed" LostFocus = "treview_Node_Text_Changed" AcceptsReturn = "True" />
               
                
                
                    <StackPanel Orientation = "Horizontal" HorizontalAlignment = "Right"  DockPanel.Dock = "Right" Visibility = "Collapsed">
                        <StackPanel.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform ScaleX = "0.5"/>
                            </TransformGroup>
                        </StackPanel.RenderTransform>
                        <Rectangle Fill = "Blue" StrokeThickness = "0"   Width = "{Binding XPath = @NotExecuted_percentage}"  HorizontalAlignment = "Right" VerticalAlignment = "Stretch"  />
                        <Rectangle Fill = "Green" StrokeThickness = "0"  Width = "{Binding XPath = @Passed_percentage}"  HorizontalAlignment = "Right" VerticalAlignment = "Stretch"  />
                        <Rectangle Fill = "OrangeRed" StrokeThickness = "0"  Width = "{Binding XPath = @Failed_percentage}"  HorizontalAlignment = "Right" VerticalAlignment = "Stretch"/>
                        <Rectangle Fill = "Red" StrokeThickness = "0" Width = "{Binding XPath = @Blocked_percentage}"  HorizontalAlignment = "Right" VerticalAlignment = "Stretch"  />
                    </StackPanel>
                

            </StackPanel>

            <HierarchicalDataTemplate.Triggers>
                <DataTrigger Binding = "{Binding XPath = @TestStatus}" Value = "Passed">
                    <Setter TargetName = "imgTestStatus" Property = "Source" Value = "../Resources/Passed.gif" />
                    <Setter TargetName = "imgTestStatus" Property = "Visibility" Value = "Visible" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding XPath = @TestStatus}" Value = "Failed">
                    <Setter TargetName = "imgTestStatus" Property = "Source" Value = "../Resources/Failed.png" />
                    <Setter TargetName = "imgTestStatus" Property = "Visibility" Value = "Visible" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding XPath = @TestStatus}" Value = "Blocked">
                    <Setter TargetName = "imgTestStatus" Property = "Source" Value = "../Resources/Blocked.png" />
                    <Setter TargetName = "imgTestStatus" Property = "Visibility" Value = "Visible" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding XPath = @TestStatus}" Value = "PartialTested">
                    <Setter TargetName = "imgTestStatus" Property = "Source" Value = "../Resources/Active.png" />
                    <Setter TargetName = "imgTestStatus" Property = "Visibility" Value = "Visible" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding XPath = @Edit}" Value = "true">
                    <Setter Property = "Visibility" TargetName = "txt" Value = "Collapsed"/>
                    <Setter TargetName = "txtEdit" Property = "Visibility" Value = "Visible" />
                    <Setter Property = "FocusManager.FocusedElement" Value = "{Binding ElementName = txtEdit}" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding XPath = @Type}" Value = "DynamicTestSuite">
                    <Setter TargetName = "imgStereotype" Property = "Source" Value = "../Resources/TestSuiteQuery.gif" />
                    <Setter TargetName = "imgStereotype" Property = "Visibility" Value = "Visible" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding XPath = @Type}" Value = "StaticTestSuite">
                    <Setter TargetName = "imgStereotype" Property = "Source" Value = "../Resources/TestSuiteStatic.gif" />
                    <Setter TargetName = "imgStereotype" Property = "Visibility" Value = "Visible" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding XPath = @Type}" Value = "TestCase">
                    <Setter TargetName = "imgStereotype" Property = "Source" Value = "../Resources/TestCase.gif" />
                    <Setter TargetName = "imgStereotype" Property = "Visibility" Value = "Visible" />
                </DataTrigger>

                <DataTrigger Binding = "{Binding XPath = @Type}" Value = "RequirementTestSuite">
                    <Setter TargetName = "imgStereotype" Property = "Source" Value = "../Resources/TestSuiteRequirement.gif" />
                    <Setter TargetName = "imgStereotype" Property = "Visibility" Value = "Visible" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding XPath = @CopyType}" Value = "DeepCopy">
                    <!--<Setter TargetName = "txtStereotyp"  Property = "Visibility" Value = "Visible"/>
                    <Setter TargetName = "txtStereotyp"  Property = "Background" Value = "Salmon"/>-->
                    <Setter TargetName = "txt"  Property = "Background" Value = "Salmon"/>
                    <Setter TargetName = "imgCopyType" Property = "Source" Value = "../Resources/DeepCopy.gif" />
                    <Setter TargetName = "imgCopyType" Property = "Visibility" Value = "Visible" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding XPath = @CopyType}" Value = "Copy">
                    <!--<Setter TargetName = "txtStereotyp"  Property = "Visibility" Value = "Visible"/>
                    <Setter TargetName = "txtStereotyp"  Property = "Background" Value = "LightSalmon"/>-->
                    <Setter TargetName = "txt"  Property = "Background" Value = "LightSalmon"/>
                    <Setter TargetName = "imgCopyType" Property = "Source" Value = "../Resources/Copy.gif" />
                    <Setter TargetName = "imgCopyType" Property = "Visibility" Value = "Visible" />
                </DataTrigger>

            </HierarchicalDataTemplate.Triggers>
        </HierarchicalDataTemplate>

        <HierarchicalDataTemplate   DataType = "{x:Type wrp:WIQLQueryItems}"  ItemsSource = "{Binding Path = childs}">
                <StackPanel Orientation = "Horizontal" VerticalAlignment = "Center" >
                    <Image Name = "imgStereotype"  />
                    <TextBlock x:Name = "txt" Text = "{Binding Name}" />
                </StackPanel>
            <HierarchicalDataTemplate.Triggers>
                <DataTrigger Binding = "{Binding ItemType}" Value = "Folder">
                    <Setter TargetName = "imgStereotype" Property = "Source" Value = "../Resources/ClosedFolder.png" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding ItemType}" Value = "FlatQuery">
                    <Setter TargetName = "imgStereotype" Property = "Source" Value = "../Resources/FlatQuery.png" />
                </DataTrigger>

                <DataTrigger Binding = "{Binding ItemType}" Value = "WILinkQuery">
                    <Setter TargetName = "imgStereotype" Property = "Source" Value = "../Resources/WILinksQuery.png" />
                </DataTrigger>
                <DataTrigger Binding = "{Binding ItemType}" Value = "TreeQuery">
                    <Setter TargetName = "imgStereotype" Property = "Source" Value = "../Resources/TreeQuery.png" />
                </DataTrigger>

            </HierarchicalDataTemplate.Triggers>
        </HierarchicalDataTemplate>
       
        <Style TargetType = "{x:Type Image}" x:Key = "toolbarImageStyle">
            <Style.Triggers>
                <DataTrigger Binding = "{Binding IsEnabled, RelativeSource = {RelativeSource AncestorLevel = 1, AncestorType = {x:Type Button}}}" Value = "False">
                    <Setter Property = "Opacity" Value = "0.50"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType = "{x:Type ListItem}" x:Key = "insertMark">
            <Setter Property = "Background" Value = "Red"/>
        </Style>

        <DataTemplate x:Key = "FieldSelect">
            <StackPanel Orientation = "Vertical">
                <ComboBox Name = "cboField"  SelectedItem = "{Binding Field, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}" ItemsSource = "{Binding Path = DataContext.LstWorkItemFields, ElementName = wndMain}" DisplayMemberPath = "FieldName">
                </ComboBox>
            </StackPanel>
        </DataTemplate>

        <DataTemplate x:Key = "FieldValueInput">
            <StackPanel Orientation = "Vertical">
                <Label Content = "{Binding Value}"  Width = "Auto" Visibility = "Collapsed" >
                    <Label.Style >
                        <Style TargetType = "{x:Type Label}">
                            <Style.Triggers>
                                <DataTrigger Binding = "{Binding IsHandeledByExtension}" Value = "true">
                                    <Setter Property = "Visibility" Value = "Visible" />
                                </DataTrigger>
                                <DataTrigger Binding = "{Binding IsHandeledByExtension}" Value = "false">
                                    <Setter Property = "Visibility" Value = "Collapsed" />
                                </DataTrigger>

                            </Style.Triggers>
                        </Style>

                    </Label.Style>
                </Label>

                <TextBox Text = "{Binding Value, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}" >
                    <TextBox.Style >
                        <Style TargetType = "{x:Type TextBox}">
                            <Style.Triggers>
                                <DataTrigger Binding = "{Binding Field.HasAllowedValues}" Value = "false">
                                    <Setter Property = "Visibility" Value = "Visible" />
                                </DataTrigger>
                                <DataTrigger Binding = "{Binding Field.HasAllowedValues}" Value = "true">
                                    <Setter Property = "Visibility" Value = "Collapsed" />
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>

                    </TextBox.Style>

                </TextBox>
                
                <ComboBox SelectedValue = "{Binding Value, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}" ItemsSource = "{Binding Field.AllowedValues}" DisplayMemberPath = "Value" SelectedValuePath = "Key">
                    <ComboBox.Style >
                        <Style TargetType = "{x:Type ComboBox}">
                            <Style.Triggers>
                                <DataTrigger Binding = "{Binding Field.HasAllowedValues}" Value = "false">
                                    <Setter Property = "Visibility" Value = "Collapsed" />
                                </DataTrigger>
                                <DataTrigger Binding = "{Binding Field.HasAllowedValues}" Value = "true">
                                    <Setter Property = "Visibility" Value = "Visible" />
                                </DataTrigger>

                            </Style.Triggers>
                        </Style>

                    </ComboBox.Style>

                </ComboBox>
            </StackPanel>
        </DataTemplate>


    </Window.Resources>
    <Window.DataContext >
        <vm:MTMViewModel />
    </Window.DataContext>

    <Grid Name = "Master" Margin = "12" HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width = "Auto" />
            <ColumnDefinition Width = "*" />
            <ColumnDefinition Width = "*" />
            <ColumnDefinition Width = "Auto"/>
            <ColumnDefinition Width = "*"/>
            
            
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height = "35" />
            <RowDefinition Height = "25" />
            <RowDefinition Height = "25" />
            <RowDefinition Height = "25" />
            <RowDefinition Height = "25" />

            <RowDefinition Height = "*" />

            
            <RowDefinition Height = "Auto" />
        </Grid.RowDefinitions>

        <Label Grid.Row = "2" Grid.Column = "3" Content = "Target Team project"  />
        <Label Grid.Row = "2" Grid.Column = "4" Content = "{Binding TargetTeamProject}"  />

        <Button Grid.Row = "2" Grid.Column = "4"   Content = "Select Team Projec" Height = "22" HorizontalAlignment = "Right" x:Name = "cmdOpenTargerTeamProject" VerticalAlignment = "Top" Width = "116" Click = "cmdOpenTargetTeamProject_Click" />

        <Label Grid.Row = "3" Grid.Column = "3" Content = "Target Test plan"  VerticalAlignment = "Top"/>
        <ComboBox Grid.Row = "3" Grid.Column = "4" Grid.ColumnSpan = "1" HorizontalAlignment = "Stretch" Name = "cboTargetTestPlan" VerticalAlignment = "Top"  SelectedValuePath = "Key" DisplayMemberPath = "Value" SelectedValue = "{Binding TargetTestPlan.TestPlanID, Mode = TwoWay}" ItemsSource = "{Binding TargetTestPlan.TestPlanList}"  />

            <StackPanel Grid.Row = "4" Grid.Column = "3"  Orientation = "Horizontal" Height = "25">
            <Button Name = "cmdNewStaticSuite" Content = "New Static Suite" Click = "cmdNewStaticSuite_Click"  IsEnabled = "{Binding isReadyForNewSuite, Mode = OneWay}" />
              
            </StackPanel>
        <ProgressBar Grid.Row = "4" Grid.Column = "3" Grid.ColumnSpan = "2"  Height = "7"  VerticalAlignment = "Bottom" HorizontalAlignment = "Stretch" Value = "{Binding TargetTestPlan.Progress.JobProgress}" Visibility = "{Binding TargetTestPlan.Progress.ShowProgress, Converter = {StaticResource BooleanToVisibilityConverter}, Mode = OneWay}" />
            <TreeView   Grid.Row = "5" Grid.Column = "3" Grid.ColumnSpan = "2" Background = "AliceBlue" Name = "treeViewTarget"  ItemsSource = "{Binding TargetTestPlan.TestSuites, Mode = TwoWay}" ItemTemplate = "{DynamicResource NodeTemplate}"  SelectedItemChanged = "treeViewTarget_SelectedItemChanged"  SelectedValuePath = "ID"   KeyDown = "treeViewTarget_KeyDown" VerticalAlignment = "Stretch" >
                <TreeView.ItemContainerStyle>
                    <Style TargetType = "{x:Type TreeViewItem}">
                        <Setter Property = "IsExpanded" Value = "True" />
                    </Style>
                </TreeView.ItemContainerStyle>
        </TreeView>
        <!--</StackPanel>-->
        <Label Content = "Source test plan" Grid.Column = "0" HorizontalAlignment = "Left" VerticalAlignment = "Top" FontSize = "18" />
        <Label Content = "Target test plan" Grid.Column = "3" HorizontalAlignment = "Left" VerticalAlignment = "Top" FontSize = "18" />
        
        <TabControl Grid.Row = "1" Grid.Column = "0" Grid.ColumnSpan = "3" Grid.RowSpan = "5" HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch" Margin = "0,0,12,0" >
            <TabItem Header = "Test suites">
                <Grid Name = "Source" Grid.Column = "0" HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch" >
                    <Grid.ColumnDefinitions>

                        <ColumnDefinition Width = "Auto"/>
                        <ColumnDefinition Width = "*"/>
                        <ColumnDefinition Width = "Auto"/>

                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height = "25" />
                        <RowDefinition Height = "25"/>
                        <RowDefinition Height = "25"/>
                        <RowDefinition Height = "*" MinHeight = "250"/>
                        <RowDefinition Height = "Auto" />

                    </Grid.RowDefinitions>

                    <Label Grid.Row = "0" Grid.Column = "0" Content = "Source Team project"    />
                    <Label Grid.Row = "0" Grid.Column = "1" Content = "{Binding SourceTeamProject}"   />
                    <Button Grid.Row = "0" Grid.Column = "1"  Content = "Select Team Projec" Height = "22" HorizontalAlignment = "Right" Name = "cmdOpenSourceTeamProject" VerticalAlignment = "Top" Width = "116" Click = "cmdOpenSourceTeamProject_Click" />

                    <Label Grid.Row = "1" Grid.Column = "0" Content = "Source test plan"  />
                    <ComboBox Grid.Row = "1" Grid.Column = "1" Grid.ColumnSpan = "1" Height = "23"  HorizontalAlignment = "Stretch"  x:Name = "cboTestPlan" VerticalAlignment = "Top" SelectedValuePath = "Key" DisplayMemberPath = "Value" SelectedValue = "{Binding SourceTestPlan.TestPlanID, Mode = TwoWay}" ItemsSource = "{Binding SourceTestPlan.TestPlanList}" />

                    <CheckBox Grid.Row = "2" Grid.Column = "1"  Content = "Show Latest Test Results" IsChecked = "{Binding SourceTestPlan.ShowTestResult, Mode = TwoWay}"  />
                    <ProgressBar Grid.Row = "2" Grid.Column = "0" Grid.ColumnSpan = "2"  Height = "7"  VerticalAlignment = "Bottom" HorizontalAlignment = "Stretch" Value = "{Binding SourceTestPlan.Progress.JobProgress}" Visibility = "{Binding SourceTestPlan.Progress.ShowProgress, Converter = {StaticResource BooleanToVisibilityConverter}, Mode = OneWay}" />
                    <TreeView  Grid.Row = "3" Grid.Column = "0" Grid.ColumnSpan = "2" Name = "treeViewSource" ItemsSource = "{Binding SourceTestPlan.TestSuites, Mode = TwoWay}"   SelectedValuePath = "ID" Grid.RowSpan = "2"  ItemTemplate = "{DynamicResource NodeTemplate}" >
                        <TreeView.ItemContainerStyle>
                            <Style TargetType = "{x:Type TreeViewItem}">
                                <Setter Property = "IsExpanded" Value = "True" />
                                <Style.Triggers>
                                </Style.Triggers>
                            </Style>
                        </TreeView.ItemContainerStyle>
                        
                    </TreeView>
                
                    <Grid Name = "Center" Grid.Column = "2" Grid.Row = "1" Grid.RowSpan = "4" HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width = "Auto"/>

                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height = "25" />
                        <RowDefinition Height = "25"/>
                        <RowDefinition Height = "10"/>
                        <RowDefinition Height = "*" MinHeight = "250"/>
                        <RowDefinition Height = "Auto" />

                    </Grid.RowDefinitions>
                    <StackPanel Grid.Column = "1" Grid.Row = "3" Orientation = "Vertical" VerticalAlignment = "Center" HorizontalAlignment = "Center" Margin = "10,0,10,0" >


                        <GroupBox Header = "Copy suite options" Height = "106" >
                            <StackPanel>
                                <CheckBox Content = "Copy recursive" Margin = "0,8,0,2"  HorizontalAlignment = "Left"  VerticalAlignment = "Top" IsChecked = "{Binding CopyRecursive, Mode = TwoWay}"/>
                                <CheckBox Content = "Convert requirement based suites to static" Margin = "0,8,6,8"  HorizontalAlignment = "Left"  VerticalAlignment = "Top" IsChecked = "{Binding ConvRequirementToStatic, Mode = TwoWay}"/>
                                    <Button Content = "Copy &gt;&gt;" Margin = "0,2,0,2" Height = "23" HorizontalAlignment = "Right"  x:Name = "cmdAddShallowCopyNode" VerticalAlignment = "Top" Width = "100" Click = "cmdAddSallowCopyNode_Click"  IsEnabled = "{Binding isTreeviewReadyForCopy, Mode = OneWay}" />
                            </StackPanel>
                        </GroupBox>


                        <GroupBox Header = "Deep Copy options" >
                            <StackPanel>
                                    <CheckBox Content = "Copy requirements" Margin = "0,8,0,2"  HorizontalAlignment = "Left"  VerticalAlignment = "Top" IsChecked = "{Binding CopyRequirement, Mode = TwoWay, UpdateSourceTrigger = PropertyChanged}"/>
                                    <DataGrid Name = "gridChangeField"  ItemsSource = "{Binding Path = LstChangeField, Mode = TwoWay}" AutoGenerateColumns = "False"  CanUserAddRows = "False" VerticalAlignment = "Stretch" Height = "Auto" >
                                        <DataGrid.Columns>
                                            <DataGridTemplateColumn  Header = "Field" Width = "Auto" CellTemplate = "{StaticResource FieldSelect}" MinWidth = "100"/>
                                            <DataGridTemplateColumn  Header = "Value" Width = "*" CellTemplate = "{StaticResource FieldValueInput}" MinWidth = "100"/>
                                        </DataGrid.Columns>
                                    </DataGrid>
                                    <Button Name = "cmdAddField" Content = "Add Field" Margin = "0,0,0,2" Height = "20" HorizontalAlignment = "Stretch" Click = "cmdAddField_Click"/>
                                    <Button Content = "Deep Copy &gt;&gt;" Margin = "0,8,0,2" Height = "23" HorizontalAlignment = "Right" x:Name = "cmdAddDeepCopyNode" VerticalAlignment = "Top" Width = "100" Click = "cmdAddDeepCopyNode_Click"  IsEnabled = "{Binding isTreeviewReadyForCopy, Mode = OneWay}" />

                                </StackPanel>
                        </GroupBox>
                    </StackPanel>
                </Grid>
                    
                </Grid>

            </TabItem>
            <TabItem Header = "Requirements">
                <Grid Background = "#FFE5E5E5"/>
            </TabItem>
            <TabItem Header = "WorkItemQueries">
                <Grid Name = "SourceQueries" Grid.Column = "0" HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch" >
                    <Grid.Background>
                        <LinearGradientBrush EndPoint = "0.5,1" StartPoint = "0.5,0">
                            <GradientStop Color = "Black" Offset = "0"/>
                            <GradientStop Color = "#FFD11919" Offset = "1"/>
                        </LinearGradientBrush>
                    </Grid.Background>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width = "Auto"/>
                        <ColumnDefinition Width = "*"/>
                        <ColumnDefinition Width = "Auto"/>
                        <ColumnDefinition Width = "Auto"/>

                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height = "25" />
                        <RowDefinition Height = "25"/>
                        <RowDefinition Height = "10"/>
                        <RowDefinition Height = "*" MinHeight = "250"/>
                        <RowDefinition Height = "Auto" />

                    </Grid.RowDefinitions>


                    <TreeView  Grid.Row = "2" Grid.Column = "0" Grid.ColumnSpan = "3" Name = "treeViewQueries"  Margin = "0,6,0,4" Grid.RowSpan = "2"  >
                        <TreeViewItem ItemsSource = "{Binding  Path = QueryStructure.childs}"
                          Header = "Work Item Queries">
                        </TreeViewItem>
                    </TreeView>

                    <Grid Name = "QueryCenter" Grid.Column = "3" Grid.Row = "1" Grid.RowSpan = "4" HorizontalAlignment = "Stretch" VerticalAlignment = "Stretch" >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width = "Auto"/>

                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height = "25" />
                            <RowDefinition Height = "25"/>
                            <RowDefinition Height = "10"/>
                            <RowDefinition Height = "*" MinHeight = "250"/>
                            <RowDefinition Height = "Auto" />

                        </Grid.RowDefinitions>
                        <StackPanel Grid.Column = "1" Grid.Row = "3" Orientation = "Vertical" VerticalAlignment = "Center" HorizontalAlignment = "Center" Margin = "10,0,10,0" >
<Button  Content = "Suite with TestCase in Query >>" VerticalAlignment = "Top" Width = "Auto" Name = "cmdAddTCLinkedQuery" Click = "cmdAddTCLinkedQuery_Click" />
                            <Button  Content = "Suite with Requirements" VerticalAlignment = "Top" Width = "200" Name = "cmdAddReqLinkedQuery" />
                   
                        </StackPanel>
                    </Grid>
                </Grid>
            </TabItem>
            
        </TabControl>

      
        <Grid Name = "Target" Grid.Column = "2"  Grid.Row = "0" Grid.RowSpan = "2" Grid.ColumnSpan = "2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width = "Auto"/>
                <ColumnDefinition Width = "*"/>
                <ColumnDefinition Width = "Auto"/>

            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height = "25" />
                <RowDefinition Height = "25"/>
                <RowDefinition Height = "10"/>
                <RowDefinition Height = "110*" MinHeight = "250"/>
                <RowDefinition Height = "61*"/>
                <RowDefinition Height = "Auto" />
            </Grid.RowDefinitions>

            <Label Grid.Row = "0" Grid.Column = "0" Content = "Teamproject" Height = "23" Visibility = "Collapsed" />
            <TextBlock Grid.Row = "0" Grid.Column = "1" Text = "{Binding TargetTeamProject}" Height = "23" Visibility = "Collapsed"  />
            <Button Visibility = "Collapsed" Grid.Row = "0" Grid.Column = "1"   Content = "Select Team Projec" Height = "22" HorizontalAlignment = "Right" x:Name = "cmdOpenTargetTeamProject" VerticalAlignment = "Top" Width = "116" Click = "cmdOpenTargetTeamProject_Click" Margin = "0,6,3,0" Grid.RowSpan = "2" />

         
        </Grid>
        
    </Grid>        

</Window>
